package com.namo.ccharticle.dao;

import com.namo.ccharticle.entity.Article;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author WangXin
 * @date 2021/5/20 9:25
 */

@Mapper
public interface ArticleMapper {
    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(String id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(Article record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(Article record);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    Article selectByPrimaryKey(String id);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(Article record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(Article record);

    /**
     * 选择全部条目新闻
     * @return
     */
    List<Article> selectAll();

}